<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div>测试对象循环</div>
</body>
<script>
    var data = {
        a: "123",
        b: "456"
    }
    // 遍历键值对的对象时候使用Object.keys
    var keys = Object.keys(data).forEach((ev) => {
        console.log(ev)
    });

</script>

</html>